package com.team7.controller;

import com.team7.common.entity.Teacher;
import com.team7.common.vo.CommonResult;
import com.team7.service.TeacherOrderService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @program: team7-Object02
 * @description: 查询讲师订单
 * @author: 王子鑫
 * @create: 2021-10-22 16:08
 **/
@RestController
@RequestMapping("/order/teacher")
public class TeacherOrderController {
    @Resource
    private TeacherOrderService teacherOrderService;

    @PostMapping("/findTeacherByName/{teacherName}")
    public CommonResult findTeacherByName(@PathVariable("teacherName") String teacherName){
        return teacherOrderService.findTeacherByName(teacherName);
    }

    @PostMapping("/findTeacherBYMobile/{mobile}")
    public CommonResult findTeacherBYMobile(@PathVariable("mobile") String mobile){
        return teacherOrderService.findTeacherBYMobile(mobile);
    }

    @PostMapping("/updateTeacherBYMobile")
    public CommonResult updateTeacherBYMobile(@RequestBody Teacher teacher){
        return teacherOrderService.updateTeacherBYMobile(teacher);
    }
}
